package com.epam.task.web.db;

import com.epam.task.web.util.Resource;

public abstract class DataAccessLayer {
	
	private Resource resource;
	private String url;
	private String driver;
	private String username;
	private String password;
	private ConnectionsPool pool;
	
	public DataAccessLayer() {
		this.resource = new Resource("db");
		this.url = resource.getValue("url");
		this.driver = resource.getValue("driver");
		this.username = resource.getValue("user");
		this.password = resource.getValue("password");
		this.pool = ConnectionsPool.getInstance(url, driver, username, password);
	}
	
	protected ConnectionsPool getPool() {
		return this.pool;
	}

}
